import pygame

pygame.init()

WINDOW_WIDTH = 600
WINDOW_HEIGHT = 300
display_surface = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
pygame.display.set_caption("Hello World")

WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
GRAY = (127, 127, 127)

display_surface.fill(WHITE)
circle_color = rect_color = BLUE

running = True
while running:
    for event in pygame.event.get():
        print(event)
        if event.type == pygame.QUIT:
            running = False
            pygame.quit()
        elif event.type == pygame.KEYDOWN:
            if event.key == pygame.K_b:
                circle_color = BLUE
            elif event.key == pygame.K_g:
                circle_color = GRAY
        elif event.type == pygame.MOUSEBUTTONDOWN:
            if rect_color == BLUE:
                rect_color = GRAY
            else:
                rect_color = BLUE

    pygame.draw.circle(display_surface, circle_color, (WINDOW_WIDTH // 2, WINDOW_HEIGHT // 2), 150)

    pygame.draw.rect(display_surface, rect_color, (0, 0, 100, 100))

    pygame.display.update()
